package hz.mobileproject.pda.ui.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import java.util.List;

import hz.mobileproject.pda.R;

/**
 * Created by hasee on 2017/11/16.
 */

public class DepartmentCheckAdapter extends BaseAdapter {

    private List<String> mList;

    private LayoutInflater mInflater;

    private Context mContext;

    public DepartmentCheckAdapter(Context context, List<String> list){
        mContext = context;
        mList = list;
        mInflater = LayoutInflater.from(context);
    }

    @Override
    public int getCount() {
        return mList == null ? 0 : mList.size();
    }

    @Override
    public Object getItem(int i) {
        return mList == null ? null : mList.get(i);
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @Override
    public View getView(final int i, View view, ViewGroup viewGroup) {
        ViewHolder vh;
        if(view == null){
            vh = new ViewHolder();
            view = mInflater.inflate(R.layout.department_check_list_item, null);
            view.setTag(vh);
        }else{
            vh = (ViewHolder) view.getTag();
        }
        return view;
    }

    static class ViewHolder{
    }

}
